<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateEngineeringChangeNoteTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('engineering_change_note', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('status');
			$table->integer('submitter')->index('submitter');
			$table->string('name');
			$table->dateTime('submit_time');
			$table->integer('approver')->nullable()->index('engineering_change_note_approver');
			$table->dateTime('approve_time')->nullable();
			$table->text('submitter_comments', 65535)->nullable();
			$table->text('approver_comments', 65535)->nullable();
			$table->integer('project');
			$table->integer('phase')->nullable();
			$table->integer('deliverable')->nullable();
			$table->integer('order')->nullable();
			$table->integer('quality')->nullable();
			$table->text('recommand_action')->nullable();
			$table->timestamps();
			$table->softDeletes();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('engineering_change_note');
	}

}
